# Contributor: Matt Smith <mcs@darkregion.net>
# Maintainer: Matt Smith <mcs@darkregion.net>
pkgname=py3-docutils
pkgver=0.21.2
pkgrel=0
pkgdesc="Documentation Utilities for Python3"
url="https://pypi.org/project/docutils"
arch="noarch"
license="BSD-2-Clause AND GPL-3.0-or-later AND Python-2.0"
depends="python3"
makedepends="py3-gpep517 py3-flit-core py3-setuptools py3-wheel"
checkdepends="py3-pytest"
subpackages="$pkgname-pyc"
source="https://files.pythonhosted.org/packages/source/d/docutils/docutils-$pkgver.tar.gz"
builddir="$srcdir/docutils-$pkgver"

replaces="py-docutils" # Backwards compatibility
provides="py-docutils=$pkgver-r$pkgrel" # Backwards compatibility

build() {
	gpep517 build-wheel --wheel-dir .dist --output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" .dist/*.whl
}

sha512sums="
7fafa331f5687448e80d299c20cdccc4b49819fa471b5f586bf0ab18c694ba43a70f58e7c76b0a70a16267585548389214e11a4998ad7fdc19a27f0f7644539c  docutils-0.21.2.tar.gz
"
